package com.vshining.cryptoki.jna.pkcs11t;

import com.sun.jna.NativeLong;
import com.sun.jna.Structure;

import java.util.Arrays;
import java.util.List;

/**
 * @author Shining Wang <shiningwang@vshining.com>
 */
@SuppressWarnings("unused")
public class CK_SLOT_INFO extends Structure {
    public byte[] slotDescription = new byte[64];
    public byte[] manufacturerID = new byte[32];
    public NativeLong flags;
    public CK_VERSION hardwareVersion;
    public CK_VERSION firmwareVersion;

    @Override
    protected List getFieldOrder() {
        return Arrays.asList(
                "slotDescription",
                "manufacturerID",
                "flags",
                "hardwareVersion",
                "firmwareVersion"
        );
    }

    public static final long CKF_TOKEN_PRESENT = 0x00000001L;
    public static final long CKF_REMOVABLE_DEVICE = 0x00000002L;
    public static final long CKF_HW_SLOT = 0x00000004L;

}
